Optimal. Leaf size=129 \[ \frac {\left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) x}{2 a}+\frac {(3 i c-d) d^2 \log (\cos (e+f x))}{a f}-\frac {(c+3 i d) d^2 \tan (e+f x)}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 129, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {3631, 3606,
3556} \begin {gather*} \frac {x \left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right )}{2 a}-\frac {d^2 (c+3 i d) \tan (e+f x)}{2 a f}+\frac {d^2 (-d+3 i c) \log (\cos (e+f x))}{a f}+\frac {(-d+i c) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3606
Rule 3631
Rubi steps
\begin {align*} \int \frac {(c+d \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx &=\frac {(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}+\frac {\int (c+d \tan (e+f x)) \left (a \left (c^2-3 i c d+2 d^2\right )-a (c+3 i d) d \tan (e+f x)\right ) \, dx}{2 a^2}\\ &=\frac {\left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) x}{2 a}-\frac {(c+3 i d) d^2 \tan (e+f x)}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}-\frac {\left ((3 i c-d) d^2\right ) \int \tan (e+f x) \, dx}{a}\\ &=\frac {\left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) x}{2 a}+\frac {(3 i c-d) d^2 \log (\cos (e+f x))}{a f}-\frac {(c+3 i d) d^2 \tan (e+f x)}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.04, size = 236, normalized size = 1.83 \begin {gather*} \frac {\sec (e+f x) (\cos (f x)+i \sin (f x)) \left (-4 (3 c+i d) d^2 f x (\cos (e)+i \sin (e))+2 \left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) f x (\cos (e)+i \sin (e))+4 (3 c+i d) d^2 \text {ArcTan}(\tan (f x)) (\cos (e)+i \sin (e))+2 i (3 c+i d) d^2 \log \left (\cos ^2(e+f x)\right ) (\cos (e)+i \sin (e))+(c+i d)^3 \cos (2 f x) (i \cos (e)+\sin (e))+(c+i d)^3 (\cos (e)-i \sin (e)) \sin (2 f x)+4 d^3 \sec (e+f x) \sin (f x) (-i+\tan (e))\right )}{4 f (a+i a \tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.24, size = 133, normalized size = 1.03
method | result | size |
derivativedivides | \(\frac {-i d^{3} \tan \left (f x +e \right )+\left (-\frac {3}{4} c^{2} d +\frac {5}{4} d^{3}-\frac {1}{4} i c^{3}-\frac {9}{4} i c \,d^{2}\right ) \ln \left (\tan \left (f x +e \right )-i\right )-\frac {-\frac {3}{2} i c^{2} d +\frac {1}{2} i d^{3}-\frac {1}{2} c^{3}+\frac {3}{2} c \,d^{2}}{\tan \left (f x +e \right )-i}-\frac {i \left (3 i c^{2} d -i d^{3}-c^{3}+3 c \,d^{2}\right ) \ln \left (\tan \left (f x +e \right )+i\right )}{4}}{f a}\) | \(133\) |
default | \(\frac {-i d^{3} \tan \left (f x +e \right )+\left (-\frac {3}{4} c^{2} d +\frac {5}{4} d^{3}-\frac {1}{4} i c^{3}-\frac {9}{4} i c \,d^{2}\right ) \ln \left (\tan \left (f x +e \right )-i\right )-\frac {-\frac {3}{2} i c^{2} d +\frac {1}{2} i d^{3}-\frac {1}{2} c^{3}+\frac {3}{2} c \,d^{2}}{\tan \left (f x +e \right )-i}-\frac {i \left (3 i c^{2} d -i d^{3}-c^{3}+3 c \,d^{2}\right ) \ln \left (\tan \left (f x +e \right )+i\right )}{4}}{f a}\) | \(133\) |
risch | \(-\frac {3 i x \,c^{2} d}{2 a}+\frac {5 i x \,d^{3}}{2 a}+\frac {c^{3} x}{2 a}+\frac {9 x c \,d^{2}}{2 a}-\frac {3 \,{\mathrm e}^{-2 i \left (f x +e \right )} c^{2} d}{4 a f}+\frac {{\mathrm e}^{-2 i \left (f x +e \right )} d^{3}}{4 a f}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} c^{3}}{4 a f}-\frac {3 i {\mathrm e}^{-2 i \left (f x +e \right )} c \,d^{2}}{4 a f}+\frac {6 d^{2} c e}{a f}+\frac {2 i d^{3} e}{a f}+\frac {2 d^{3}}{f a \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}+\frac {3 i d^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c}{a f}-\frac {d^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{a f}\) | \(224\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.77, size = 204, normalized size = 1.58 \begin {gather*} \frac {2 \, {\left (c^{3} - 3 i \, c^{2} d + 9 \, c d^{2} + 5 i \, d^{3}\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} + i \, c^{3} - 3 \, c^{2} d - 3 i \, c d^{2} + d^{3} + {\left (i \, c^{3} - 3 \, c^{2} d - 3 i \, c d^{2} + 9 \, d^{3} + 2 \, {\left (c^{3} - 3 i \, c^{2} d + 9 \, c d^{2} + 5 i \, d^{3}\right )} f x\right )} e^{\left (2 i \, f x + 2 i \, e\right )} - 4 \, {\left ({\left (-3 i \, c d^{2} + d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-3 i \, c d^{2} + d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{4 \, {\left (a f e^{\left (4 i \, f x + 4 i \, e\right )} + a f e^{\left (2 i \, f x + 2 i \, e\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.44, size = 260, normalized size = 2.02 \begin {gather*} \frac {2 d^{3}}{a f e^{2 i e} e^{2 i f x} + a f} + \begin {cases} \frac {\left (i c^{3} - 3 c^{2} d - 3 i c d^{2} + d^{3}\right ) e^{- 2 i e} e^{- 2 i f x}}{4 a f} & \text {for}\: a f e^{2 i e} \neq 0 \\x \left (- \frac {c^{3} - 3 i c^{2} d + 9 c d^{2} + 5 i d^{3}}{2 a} + \frac {\left (c^{3} e^{2 i e} + c^{3} - 3 i c^{2} d e^{2 i e} + 3 i c^{2} d + 9 c d^{2} e^{2 i e} - 3 c d^{2} + 5 i d^{3} e^{2 i e} - i d^{3}\right ) e^{- 2 i e}}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {i d^{2} \cdot \left (3 c + i d\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} + \frac {x \left (c^{3} - 3 i c^{2} d + 9 c d^{2} + 5 i d^{3}\right )}{2 a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.73, size = 186, normalized size = 1.44 \begin {gather*} -\frac {\frac {4 i \, d^{3} \tan \left (f x + e\right )}{a} - \frac {{\left (i \, c^{3} + 3 \, c^{2} d - 3 i \, c d^{2} - d^{3}\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a} + \frac {{\left (i \, c^{3} + 3 \, c^{2} d + 9 i \, c d^{2} - 5 \, d^{3}\right )} \log \left (-i \, \tan \left (f x + e\right ) - 1\right )}{a} + \frac {-i \, c^{3} \tan \left (f x + e\right ) - 3 \, c^{2} d \tan \left (f x + e\right ) - 9 i \, c d^{2} \tan \left (f x + e\right ) + 5 \, d^{3} \tan \left (f x + e\right ) - 3 \, c^{3} - 3 i \, c^{2} d - 3 \, c d^{2} - 3 i \, d^{3}}{a {\left (\tan \left (f x + e\right ) - i\right )}}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.66, size = 175, normalized size = 1.36 \begin {gather*} -\frac {\frac {3\,c^2\,d-d^3}{2\,a}+\frac {\left (d^3\,1{}\mathrm {i}+3\,c\,d^2\right )\,1{}\mathrm {i}}{2\,a}-\frac {-d^3+c^3\,1{}\mathrm {i}}{2\,a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}-\frac {d^3\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}{a\,f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (-c^3\,1{}\mathrm {i}-3\,c^2\,d+c\,d^2\,3{}\mathrm {i}+d^3\right )}{4\,a\,f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (c^3\,1{}\mathrm {i}+3\,c^2\,d+c\,d^2\,9{}\mathrm {i}-5\,d^3\right )}{4\,a\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________